home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gcc_260.zip / gcc_260 / gcc.info-6 (.txt) < prev    next >
GNU Info File  |  1994-07-14  |  47KB  |  850 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.54 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Configurations,  Next: Other Dir,  Up: Installation
  23. Configurations Supported by GNU CC
  24. ==================================
  25.    Here are the possible CPU types:
  26.      1750a, a29k, alpha, arm, cN, clipper, elxsi, h8300, hppa1.0,
  27.      hppa1.1, i370, i386, i486, i860, i960, m68000, m68k, m88k, mips,
  28.      ns32k, pyramid, romp, rs6000, sh, sparc, sparclite, sparc64, vax,
  29.      we32k.
  30.    Here are the recognized company names.  As you can see, customary
  31. abbreviations are used rather than the longer official names.
  32.      acorn, alliant, altos, apollo, att, bull, cbm, convergent, convex,
  33.      crds, dec, dg, dolphin, elxsi, encore, harris, hitachi, hp, ibm,
  34.      intergraph, isi, mips, motorola, ncr, next, ns, omron, plexus,
  35.      sequent, sgi, sony, sun, tti, unicom.
  36.    The company name is meaningful only to disambiguate when the rest of
  37. the information supplied is insufficient.  You can omit it, writing
  38. just `CPU-SYSTEM', if it is not needed.  For example, `vax-ultrix4.2'
  39. is equivalent to `vax-dec-ultrix4.2'.
  40.    Here is a list of system types:
  41.      386bsd, aix, acis, amigados, aos, aout, bosx, bsd, clix, ctix,
  42.      cxux, dgux, dynix, ebmon, elf, esix, freebsd, hms, genix, gnu,
  43.      hiux, hpux, iris, irix, isc, linux, luna, lynxos, mach, minix,
  44.      msdos, mvs, netbsd, newsos, nindy, ns, osf, osfrose, riscix,
  45.      riscos, rtu, sco, solaris, sunos, sym, sysv, ultrix, unicos,
  46.      uniplus, unos, vms, vxworks, xenix.
  47. You can omit the system type; then `configure' guesses the operating
  48. system from the CPU and company.
  49.    You can add a version number to the system type; this may or may not
  50. make a difference.  For example, you can write `bsd4.3' or `bsd4.4' to
  51. distinguish versions of BSD.  In practice, the version number is most
  52. needed for `sysv3' and `sysv4', which are often treated differently.
  53.    If you specify an impossible combination such as `i860-dg-vms', then
  54. you may get an error message from `configure', or it may ignore part of
  55. the information and do the best it can with the rest.  `configure'
  56. always prints the canonical name for the alternative that it used.  GNU
  57. CC does not support all possible alternatives.
  58.    Often a particular model of machine has a name.  Many machine names
  59. are recognized as aliases for CPU/company combinations.  Thus, the
  60. machine name `sun3', mentioned above, is an alias for `m68k-sun'.
  61. Sometimes we accept a company name as a machine name, when the name is
  62. popularly used for a particular machine.  Here is a table of the known
  63. machine names:
  64.      3300, 3b1, 3bN, 7300, altos3068, altos, apollo68, att-7300,
  65.      balance, convex-cN, crds, decstation-3100, decstation, delta,
  66.      encore, fx2800, gmicro, hp7NN, hp8NN, hp9k2NN, hp9k3NN, hp9k7NN,
  67.      hp9k8NN, iris4d, iris, isi68, m3230, magnum, merlin, miniframe,
  68.      mmax, news-3600, news800, news, next, pbd, pc532, pmax, powerpc,
  69.      ps2, risc-news, rtpc, sun2, sun386i, sun386, sun3, sun4, symmetry,
  70.      tower-32, tower.
  71. Remember that a machine name specifies both the cpu type and the company
  72. name.  If you want to install your own homemade configuration files,
  73. you can use `local' as the company name to access them.  If you use
  74. configuration `CPU-local', the configuration name without the cpu prefix
  75. is used to form the configuration file names.
  76.    Thus, if you specify `m68k-local', configuration uses files
  77. `local.md', `local.h', `local.c', `xm-local.h', `t-local', and
  78. `x-local', all in the directory `config/m68k'.
  79.    Here is a list of configurations that have special treatment or
  80. special things you must know:
  81. `1750a-*-*'
  82.      MIL-STD-1750A processors.  This port is preliminary.
  83.      You should ignore a fatal error during the building of libgcc
  84.      (libgcc is not yet implemented for the 1750A.)
  85.      The Tektronix MIL-STD-1750A Assembler requires the file
  86.      `m1750.inc', which is found in the directory `config/1750a'.
  87.      GNU CC produced the same sections as the Fairchild F9450 C
  88.      Compiler, namely:
  89.     `NREL'
  90.           The program code section.
  91.     `SREL'
  92.           The read/write (RAM) data section.
  93.     `KREL'
  94.           The read-only (ROM) constants section.
  95.     `IREL'
  96.           Initialization section (code to copy KREL to SREL).
  97.      The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16).
  98.      This means that type `char' is represented with a 16-bit word per
  99.      character.  The 1750A's "Load/Store Upper/Lower Byte" instructions
  100.      are not used by GNU CC.
  101.      There is a problem with long argument lists to functions.  The
  102.      compiler aborts if the sum of space needed by all arguments
  103.      exceeds 14 words.  This is because the arguments are passed in
  104.      registers (R0..R13) not on the stack, and there is a problem with
  105.      passing further arguments (i.e.  beyond those in R0..R13) via the
  106.      stack.
  107.      If efficiency is less important than using long argument lists, you
  108.      can change the definition of the `FUNCTION_ARG' macro in
  109.      `config/1750/1750a.h' to always return zero.  If you do that, GNU
  110.      CC will pass all parameters on the stack.
  111. `alpha-*-osf1'
  112.      Systems using processors that implement the DEC Alpha architecture
  113.      and are running the OSF/1 operating system, for example the DEC
  114.      Alpha AXP systems.  (VMS on the Alpha is not currently supported
  115.      by GNU CC.)
  116.      GNU CC writes a `.verstamp' directive to the assembler output file
  117.      unless it is built as a cross-compiler.  It gets the version to
  118.      use from the system header file `/usr/include/stamp.h'.  If you
  119.      install a new version of OSF/1, you should rebuild GCC to pick up
  120.      the new version stamp.
  121.      Note that since the Alpha is a 64-bit architecture,
  122.      cross-compilers from 32-bit machines will not generate code as
  123.      efficient as that generated when the compiler is running on a
  124.      64-bit machine because many optimizations that depend on being
  125.      able to represent a word on the target in an integral value on the
  126.      host cannot be performed.  Building cross-compilers on the Alpha
  127.      for 32-bit machines has only been tested in a few cases and may
  128.      not work properly.
  129.      `make compare' may fail on old versions of OSF/1 unless you add
  130.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  131.      assembler input file is stored in the object file, and that makes
  132.      comparison fail if it differs between the `stage1' and `stage2'
  133.      compilations.  The option `-save-temps' forces a fixed name to be
  134.      used for the assembler input file, instead of a randomly chosen
  135.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  136.      fail without that option.  If you add `-save-temps', you will have
  137.      to manually delete the `.i' and `.s' files after each series of
  138.      compilations.
  139.      GNU CC now supports both the native (ECOFF) debugging format used
  140.      by DBX and GDB and an encapsulated STABS format for use only with
  141.      GDB.  See the discussion of the `--with-stabs' option of
  142.      `configure' above for more information on these formats and how to
  143.      select them.
  144.      There is a bug in DEC's assembler that produces incorrect line
  145.      numbers for ECOFF format when the `.align' directive is used.  To
  146.      work around this problem, GNU CC will not emit such alignment
  147.      directives while writing ECOFF format debugging information even
  148.      if optimization is being performed.  Unfortunately, this has the
  149.      very undesirable side-effect that code addresses when `-O' is
  150.      specified are different depending on whether or not `-g' is also
  151.      specified.
  152.      To avoid this behavior, specify `-gstabs+' and use GDB instead of
  153.      DBX.  DEC is now aware of this problem with the assembler and
  154.      hopes to provide a fix shortly.
  155. `arm'
  156.      Advanced RISC Machines ARM-family processors.  These are often
  157.      used in embedded applications.  There are no standard Unix
  158.      configurations.  This configuration corresponds to the basic
  159.      instruction sequences and will produce a.out format object modules.
  160.      You may need to make a variant of the file `arm.h' for your
  161.      particular configuration.
  162. `arm-*-riscix'
  163.      The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD
  164.      Unix.  If you are running a version of RISC iX prior to 1.2 then
  165.      you must specify the version number during configuration.  Note
  166.      that the assembler shipped with RISC iX does not support stabs
  167.      debugging information; a new version of the assembler, with stabs
  168.      support included, is now available from Acorn.
  169. `a29k'
  170.      AMD Am29k-family processors.  These are normally used in embedded
  171.      applications.  There are no standard Unix configurations.  This
  172.      configuration corresponds to AMD's standard calling sequence and
  173.      binary interface and is compatible with other 29k tools.
  174.      You may need to make a variant of the file `a29k.h' for your
  175.      particular configuration.
  176. `a29k-*-bsd'
  177.      AMD Am29050 used in a system running a variant of BSD Unix.
  178. `decstation-*'
  179.      DECstations can support three different personalities: Ultrix, DEC
  180.      OSF/1, and OSF/rose.  To configure GCC for these platforms use the
  181.      following configurations:
  182.     `decstation-ultrix'
  183.           Ultrix configuration.
  184.     `decstation-osf1'
  185.           Dec's version of OSF/1.
  186.     `decstation-osfrose'
  187.           Open Software Foundation reference port of OSF/1 which uses
  188.           the OSF/rose object file format instead of ECOFF.  Normally,
  189.           you would not select this configuration.
  190.      The MIPS C compiler needs to be told to increase its table size
  191.      for switch statements with the `-Wf,-XNg1500' option in order to
  192.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  193.      you also need to use `-Olimit 3000'.  Both of these options are
  194.      automatically generated in the `Makefile' that the shell script
  195.      `configure' builds.  If you override the `CC' make variable and
  196.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  197.      3000'.
  198. `elxsi-elxsi-bsd'
  199.      The Elxsi's C compiler has known limitations that prevent it from
  200.      compiling GNU C.  Please contact `mrs@cygnus.com' for more details.
  201. `h8300-*-*'
  202.      The calling convention and structure layout has changed in release
  203.      2.6.  All code must be recompiled.  The calling convention now
  204.      passes the first three arguments in function calls in registers.
  205.      Structures are no longer a multiple of 2 bytes.
  206. `hppa*-*-*'
  207.      There are two variants of this CPU, called 1.0 and 1.1, which have
  208.      different machine descriptions.  You must use the right one for
  209.      your machine.  All 7NN machines and 8N7 machines use 1.1, while
  210.      all other 8NN machines use 1.0.
  211.      The easiest way to handle this problem is to use `configure hpNNN'
  212.      or `configure hpNNN-hpux', where NNN is the model number of the
  213.      machine.  Then `configure' will figure out if the machine is a 1.0
  214.      or 1.1.  Use `uname -a' to find out the model number of your
  215.      machine.
  216.      `-g' does not work on HP-UX, since that system uses a peculiar
  217.      debugging format which GNU CC does not know about.  However, `-g'
  218.      will work if you also use GAS and GDB in conjunction with GCC.  We
  219.      highly recommend using GAS for all HP-PA configurations.
  220.      You should be using GAS-2.3 (or later) along with GDB-4.12 (or
  221.      later).  These can be retrieved from all the traditional GNU ftp
  222.      archive sites.
  223.      Build GAS and install the resulting binary as:
  224.           /usr/local/lib/gcc-lib/CONFIGURATION/GCCVERSION/as
  225.      where CONFIGURATION is the configuration name (perhaps
  226.      `hpNNN-hpux') and GCCVERSION is the GNU CC version number.  Do
  227.      this *before* starting the build process, otherwise you will get
  228.      errors from the HPUX assembler while building `libgcc2.a'.  The
  229.      command
  230.           make install-dir
  231.      will create the necessary directory hierarchy so you can install
  232.      GAS before building GCC.
  233.      To enable debugging, configure GNU CC with the `--with-gnu-as'
  234.      option before building.
  235.      It has been reported that GNU CC produces invalid assembly code for
  236.      1.1 machines running HP-UX 8.02 when using the HP assembler.
  237.      Typically the errors look like this:
  238.           as: bug.s @line#15 [err#1060]
  239.             Argument 0 or 2 in FARG upper
  240.                    - lookahead = ARGW1=FR,RTNVAL=GR
  241.           as: foo.s @line#28 [err#1060]
  242.             Argument 0 or 2 in FARG upper
  243.                    - lookahead = ARGW1=FR
  244.      You can check the version of HP-UX you are running by executing
  245.      the command `uname -r'.   If you are indeed running HP-UX 8.02 on
  246.      a PA and using the HP assembler then configure GCC with
  247.      "hpNNN-hpux8.02".
  248. `i370-*-*'
  249.      This port is very preliminary and has many known bugs.  We hope to
  250.      have a higher-quality port for this machine soon.
  251. `i386-*-linux'
  252.      Bash-1.12 has a bug that causes configure to fail.  The symptom is
  253.      that the c++ subdirectory, cp, is not configured.  Bash-1.14 and
  254.      later work fine.
  255. `i386-*-sco'
  256.      Compilation with RCC is recommended.  Also, it may be a good idea
  257.      to link with GNU malloc instead of the malloc that comes with the
  258.      system.
  259. `i386-*-sco3.2.4'
  260.      Use this configuration for SCO release 3.2 version 4.
  261. `i386-*-isc'
  262.      It may be good idea to link with GNU malloc instead of the malloc
  263.      that comes with the system.
  264. `i386-*-esix'
  265.      It may be good idea to link with GNU malloc instead of the malloc
  266.      that comes with the system.
  267. `i386-ibm-aix'
  268.      You need to use GAS version 2.1 or later, and and LD from GNU
  269.      binutils version 2.2 or later.
  270. `i386-sequent'
  271.      Go to the Berkeley universe before compiling.  In addition, you
  272.      probably need to create a file named `string.h' containing just
  273.      one line: `#include <strings.h>'.
  274. `i386-sun-sunos4'
  275.      You may find that you need another version of GNU CC to begin
  276.      bootstrapping with, since the current version when built with the
  277.      system's own compiler seems to get an infinite loop compiling part
  278.      of `libgcc2.c'.  GNU CC version 2 compiled with GNU CC (any
  279.      version) seems not to have this problem.
  280.      See *Note Sun Install::, for information on installing GNU CC on
  281.      Sun systems.
  282. `i860-intel-osf1'
  283.      This is the Paragon.  If you have version 1.0 of the operating
  284.      system, see *Note Installation Problems::, for special things you
  285.      need to do to compensate for peculiarities in the system.
  286. `m68000-hp-bsd'
  287.      HP 9000 series 200 running BSD.  Note that the C compiler that
  288.      comes with this system cannot compile GNU CC; contact
  289.      `law@cs.utah.edu' to get binaries of GNU CC for bootstrapping.
  290. `m68k-altos'
  291.      Altos 3068.  You must use the GNU assembler, linker and debugger.
  292.      Also, you must fix a kernel bug.  Details in the file
  293.      `README.ALTOS'.
  294. `m68k-att-sysv'
  295.      AT&T 3b1, a.k.a. 7300 PC.  Special procedures are needed to
  296.      compile GNU CC with this machine's standard C compiler, due to
  297.      bugs in that compiler.  You can bootstrap it more easily with
  298.      previous versions of GNU CC if you have them.
  299.      Installing GNU CC on the 3b1 is difficult if you do not already
  300.      have GNU CC running, due to bugs in the installed C compiler.
  301.      However, the following procedure might work.  We are unable to
  302.      test it.
  303.        1. Comment out the `#include "config.h"' line on line 37 of
  304.           `cccp.c' and do `make cpp'.  This makes a preliminary version
  305.           of GNU cpp.
  306.        2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to
  307.           that file name.
  308.        3. Undo your change in `cccp.c', or reinstall the original
  309.           version, and do `make cpp' again.
  310.        4. Copy this final version of GNU cpp into `/lib/cpp'.
  311.        5. Replace every occurrence of `obstack_free' in the file
  312.           `tree.c' with `_obstack_free'.
  313.        6. Run `make' to get the first-stage GNU CC.
  314.        7. Reinstall the original version of `/lib/cpp'.
  315.        8. Now you can compile GNU CC with itself and install it in the
  316.           normal fashion.
  317. `m68k-bull-sysv'
  318.      Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU
  319.      CC works either with native assembler or GNU assembler. You can use
  320.      GNU assembler with native coff generation by providing
  321.      `--with-gnu-as' to the configure script or use GNU assembler with
  322.      dbx-in-coff encapsulation by providing `--with-gnu-as --stabs'.
  323.      For any problem with native assembler or for availability of the
  324.      DPX/2 port of GAS, contact `F.Pierresteguy@frcl.bull.fr'.
  325. `m68k-crds-unox'
  326.      Use `configure unos' for building on Unos.
  327.      The Unos assembler is named `casm' instead of `as'.  For some
  328.      strange reason linking `/bin/as' to `/bin/casm' changes the
  329.      behavior, and does not work.  So, when installing GNU CC, you
  330.      should install the following script as `as' in the subdirectory
  331.      where the passes of GCC are installed:
  332.           #!/bin/sh
  333.           casm $*
  334.      The default Unos library is named `libunos.a' instead of `libc.a'.
  335.      To allow GNU CC to function, either change all references to
  336.      `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to
  337.      `/lib/libunos.a'.
  338.      When compiling GNU CC with the standard compiler, to overcome bugs
  339.      in the support of `alloca', do not use `-O' when making stage 2.
  340.      Then use the stage 2 compiler with `-O' to make the stage 3
  341.      compiler.  This compiler will have the same characteristics as the
  342.      usual stage 2 compiler on other systems.  Use it to make a stage 4
  343.      compiler and compare that with stage 3 to verify proper
  344.      compilation.
  345.      (Perhaps simply defining `ALLOCA' in `x-crds' as described in the
  346.      comments there will make the above paragraph superfluous.  Please
  347.      inform us of whether this works.)
  348.      Unos uses memory segmentation instead of demand paging, so you
  349.      will need a lot of memory.  5 Mb is barely enough if no other
  350.      tasks are running.  If linking `cc1' fails, try putting the object
  351.      files into a library and linking from that library.
  352. `m68k-hp-hpux'
  353.      HP 9000 series 300 or 400 running HP-UX.  HP-UX version 8.0 has a
  354.      bug in the assembler that prevents compilation of GNU CC.  To fix
  355.      it, get patch PHCO_0800 from HP.
  356.      In addition, if you wish to use gas `--with-gnu-as' you must use
  357.      gas version 2.1 or later, and you must use the GNU linker version
  358.      2.1 or later.  Earlier versions of gas relied upon a program which
  359.      converted the gas output into the native HP/UX format, but that
  360.      program has not been kept up to date.  gdb does not understand
  361.      that native HP/UX format, so you must use gas if you wish to use
  362.      gdb.
  363. `m68k-sun'
  364.      Sun 3.  We do not provide a configuration file to use the Sun FPA
  365.      by default, because programs that establish signal handlers for
  366.      floating point traps inherently cannot work with the FPA.
  367.      See *Note Sun Install::, for information on installing GNU CC on
  368.      Sun systems.
  369. `m88k-*-svr3'
  370.      Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
  371.      These systems tend to use the Green Hills C, revision 1.8.5, as the
  372.      standard C compiler.  There are apparently bugs in this compiler
  373.      that result in object files differences between stage 2 and stage
  374.      3.  If this happens, make the stage 4 compiler and compare it to
  375.      the stage 3 compiler.  If the stage 3 and stage 4 object files are
  376.      identical, this suggests you encountered a problem with the
  377.      standard C compiler; the stage 3 and 4 compilers may be usable.
  378.      It is best, however, to use an older version of GNU CC for
  379.      bootstrapping if you have one.
  380. `m88k-*-dgux'
  381.      Motorola m88k running DG/UX.  To build native or cross compilers on
  382.      DG/UX, you must first change to the 88open BCS software development
  383.      environment.  This is done by issuing this command:
  384.           eval `sde-target m88kbcs`
  385. `m88k-tektronix-sysv3'
  386.      Tektronix XD88 running UTekV 3.2e.  Do not turn on optimization
  387.      while building stage1 if you bootstrap with the buggy Green Hills
  388.      compiler.  Also, The bundled LAI System V NFS is buggy so if you
  389.      build in an NFS mounted directory, start from a fresh reboot, or
  390.      avoid NFS all together.  Otherwise you may have trouble getting
  391.      clean comparisons between stages.
  392. `mips-mips-bsd'
  393.      MIPS machines running the MIPS operating system in BSD mode.  It's
  394.      possible that some old versions of the system lack the functions
  395.      `memcpy', `memcmp', and `memset'.  If your system lacks these, you
  396.      must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in
  397.      `mips-bsd.h'.
  398.      The MIPS C compiler needs to be told to increase its table size
  399.      for switch statements with the `-Wf,-XNg1500' option in order to
  400.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  401.      you also need to use `-Olimit 3000'.  Both of these options are
  402.      automatically generated in the `Makefile' that the shell script
  403.      `configure' builds.  If you override the `CC' make variable and
  404.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  405.      3000'.
  406. `mips-mips-riscos*'
  407.      The MIPS C compiler needs to be told to increase its table size
  408.      for switch statements with the `-Wf,-XNg1500' option in order to
  409.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  410.      you also need to use `-Olimit 3000'.  Both of these options are
  411.      automatically generated in the `Makefile' that the shell script
  412.      `configure' builds.  If you override the `CC' make variable and
  413.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  414.      3000'.
  415.      MIPS computers running RISC-OS can support four different
  416.      personalities: default, BSD 4.3, System V.3, and System V.4 (older
  417.      versions of RISC-OS don't support V.4).  To configure GCC for
  418.      these platforms use the following configurations:
  419.     `mips-mips-riscos`rev''
  420.           Default configuration for RISC-OS, revision `rev'.
  421.     `mips-mips-riscos`rev'bsd'
  422.           BSD 4.3 configuration for RISC-OS, revision `rev'.
  423.     `mips-mips-riscos`rev'sysv4'
  424.           System V.4 configuration for RISC-OS, revision `rev'.
  425.     `mips-mips-riscos`rev'sysv'
  426.           System V.3 configuration for RISC-OS, revision `rev'.
  427.      The revision `rev' mentioned above is the revision of RISC-OS to
  428.      use.  You must reconfigure GCC when going from a RISC-OS revision
  429.      4 to RISC-OS revision 5.  This has the effect of avoiding a linker
  430.      bug (see *Note Installation Problems::, for more details).
  431. `mips-sgi-*'
  432.      Silicon Graphics MIPS machines running IRIX.  In order to compile
  433.      GCC on an SGI the "c.hdr.lib" option must be installed from the
  434.      CD-ROM supplied from Silicon Graphics.  This is found on the 2nd
  435.      CD in release 4.0.1.
  436.      `make compare' may fail on version 5 of IRIX unless you add
  437.      `-save-temps' to `CFLAGS'.  On these systems, the name of the
  438.      assembler input file is stored in the object file, and that makes
  439.      comparison fail if it differs between the `stage1' and `stage2'
  440.      compilations.  The option `-save-temps' forces a fixed name to be
  441.      used for the assembler input file, instead of a randomly chosen
  442.      name in `/tmp'.  Do not add `-save-temps' unless the comparisons
  443.      fail without that option.  If you do you `-save-temps', you will
  444.      have to manually delete the `.i' and `.s' files after each series
  445.      of compilations.
  446.      The MIPS C compiler needs to be told to increase its table size
  447.      for switch statements with the `-Wf,-XNg1500' option in order to
  448.      compile `cp/parse.c'.  If you use the `-O2' optimization option,
  449.      you also need to use `-Olimit 3000'.  Both of these options are
  450.      automatically generated in the `Makefile' that the shell script
  451.      `configure' builds.  If you override the `CC' make variable and
  452.      use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit
  453.      3000'.
  454.      On Irix version 4.0.5F, and perhaps on some other versions as well,
  455.      there is an assembler bug that reorders instructions incorrectly.
  456.      To work around it, specify the target configuration
  457.      `mips-sgi-irix4loser'.  This configuration inhibits assembler
  458.      optimization.
  459.      In a compiler configured with target `mips-sgi-irix4', you can turn
  460.      off assembler optimization by using the `-noasmopt' option.  This
  461.      compiler option passes the option `-O0' to the assembler, to
  462.      inhibit reordering.
  463.      The `-noasmopt' option can be useful for testing whether a problem
  464.      is due to erroneous assembler reordering.  Even if a problem does
  465.      not go away with `-noasmopt', it may still be due to assembler
  466.      reordering--perhaps GNU CC itself was miscompiled as a result.
  467.      See the file `README.IRIX5' for information on how to make
  468.      debugging work.
  469. `mips-sony-sysv'
  470.      Sony MIPS NEWS.  This works in NEWSOS 5.0.1, but not in 5.0.2
  471.      (which uses ELF instead of COFF).  Support for 5.0.2 will probably
  472.      be provided soon by volunteers.  In particular, the linker does
  473.      not like the code generated by GCC when shared libraries are
  474.      linked in.
  475. `ns32k-encore'
  476.      Encore ns32000 system.  Encore systems are supported only under
  477.      BSD.
  478. `ns32k-*-genix'
  479.      National Semiconductor ns32000 system.  Genix has bugs in `alloca'
  480.      and `malloc'; you must get the compiled versions of these from GNU
  481.      Emacs.
  482. `ns32k-sequent'
  483.      Go to the Berkeley universe before compiling.  In addition, you
  484.      probably need to create a file named `string.h' containing just
  485.      one line: `#include <strings.h>'.
  486. `ns32k-utek'
  487.      UTEK ns32000 system ("merlin").  The C compiler that comes with
  488.      this system cannot compile GNU CC; contact `tektronix!reed!mason'
  489.      to get binaries of GNU CC for bootstrapping.
  490. `romp-*-aos'
  491. `romp-*-mach'
  492.      The only operating systems supported for the IBM RT PC are AOS and
  493.      MACH.  GNU CC does not support AIX running on the RT.  We
  494.      recommend you compile GNU CC with an earlier version of itself; if
  495.      you compile GNU CC with `hc', the Metaware compiler, it will work,
  496.      but you will get mismatches between the stage 2 and stage 3
  497.      compilers in various files.  These errors are minor differences in
  498.      some floating-point constants and can be safely ignored; the stage
  499.      3 compiler is correct.
  500. `rs6000-*-aix'
  501.      If you are running AIX version 3.2.5 and have XLC version 1.3.0.0,
  502.      you must obtain XLC 1.3.0.2 by requesting PTF 421749 from IBM.  If
  503.      you are using an older version of AIX you may have an old version
  504.      of the IBM assembler, which cannot correctly handle debugging
  505.      directives.  See the file `README.RS6000' for more details.
  506.      The PowerPC and POWER2 architectures are now supported, but have
  507.      not been very extensively tested due to lack of appropriate
  508.      systems.  Only AIX is supported on the PowerPC.  GNU CC does not
  509.      yet support the 64-bit PowerPC instructions.
  510.      Objective C does not work on this architecture.
  511.      AIX on the RS/6000 provides support (NLS) for environments outside
  512.      of the United States.  Compilers and assemblers use NLS to support
  513.      locale-specific representations of various objects including
  514.      floating-point numbers ("." vs "," for separating decimal
  515.      fractions).  There have been problems reported where the library
  516.      linked with GNU CC does not produce the same floating-point
  517.      formats that the assembler accepts.  If you have this problem, set
  518.      the LANG environment variable to "C" or "En_US".
  519. `vax-dec-ultrix'
  520.      Don't try compiling with Vax C (`vcc').  It produces incorrect code
  521.      in some cases (for example, when `alloca' is used).
  522.      Meanwhile, compiling `cp/parse.c' with pcc does not work because of
  523.      an internal table size limitation in that compiler.  To avoid this
  524.      problem, compile just the GNU C compiler first, and use it to
  525.      recompile building all the languages that you want to run.
  526. `sparc-sun-*'
  527.      See *Note Sun Install::, for information on installing GNU CC on
  528.      Sun systems.
  529. `vax-dec-vms'
  530.      See *Note VMS Install::, for details on how to install GNU CC on
  531.      VMS.
  532. `we32k-*-*'
  533.      These computers are also known as the 3b2, 3b5, 3b20 and other
  534.      similar names.  (However, the 3b1 is actually a 68000; see *Note
  535.      Configurations::.)
  536.      Don't use `-g' when compiling with the system's compiler.  The
  537.      system's linker seems to be unable to handle such a large program
  538.      with debugging information.
  539.      The system's compiler runs out of capacity when compiling `stmt.c'
  540.      in GNU CC.  You can work around this by building `cpp' in GNU CC
  541.      first, then use that instead of the system's preprocessor with the
  542.      system's C compiler to compile `stmt.c'.  Here is how:
  543.           mv /lib/cpp /lib/cpp.att
  544.           cp cpp /lib/cpp.gnu
  545.           echo '/lib/cpp.gnu -traditional ${1+"$@"}' > /lib/cpp
  546.           chmod +x /lib/cpp
  547.      The system's compiler produces bad code for some of the GNU CC
  548.      optimization files.  So you must build the stage 2 compiler without
  549.      optimization.  Then build a stage 3 compiler with optimization.
  550.      That executable should work.  Here are the necessary commands:
  551.           make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
  552.           make stage2
  553.           make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
  554.      You may need to raise the ULIMIT setting to build a C++ compiler,
  555.      as the file `cc1plus' is larger than one megabyte.
  556. File: gcc.info,  Node: Other Dir,  Next: Cross-Compiler,  Prev: Configurations,  Up: Installation
  557. Compilation in a Separate Directory
  558. ===================================
  559.    If you wish to build the object files and executables in a directory
  560. other than the one containing the source files, here is what you must
  561. do differently:
  562.   1. Make sure you have a version of Make that supports the `VPATH'
  563.      feature.  (GNU Make supports it, as do Make versions on most BSD
  564.      systems.)
  565.   2. If you have ever run `configure' in the source directory, you must
  566.      undo the configuration.  Do this by running:
  567.           make distclean
  568.   3. Go to the directory in which you want to build the compiler before
  569.      running `configure':
  570.           mkdir gcc-sun3
  571.           cd gcc-sun3
  572.      On systems that do not support symbolic links, this directory must
  573.      be on the same file system as the source code directory.
  574.   4. Specify where to find `configure' when you run it:
  575.           ../gcc/configure ...
  576.      This also tells `configure' where to find the compiler sources;
  577.      `configure' takes the directory from the file name that was used to
  578.      invoke it.  But if you want to be sure, you can specify the source
  579.      directory with the `--srcdir' option, like this:
  580.           ../gcc/configure --srcdir=../gcc sun3
  581.      The directory you specify with `--srcdir' need not be the same as
  582.      the one that `configure' is found in.
  583.    Now, you can run `make' in that directory.  You need not repeat the
  584. configuration steps shown above, when ordinary source files change.  You
  585. must, however, run `configure' again when the configuration files
  586. change, if your system does not support symbolic links.
  587. File: gcc.info,  Node: Cross-Compiler,  Next: Sun Install,  Prev: Other Dir,  Up: Installation
  588. Building and Installing a Cross-Compiler
  589. ========================================
  590.    GNU CC can function as a cross-compiler for many machines, but not
  591.    * Cross-compilers for the Mips as target using the Mips assembler
  592.      currently do not work, because the auxiliary programs
  593.      `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything
  594.      but a Mips.  It does work to cross compile for a Mips if you use
  595.      the GNU assembler and linker.
  596.    * Cross-compilers between machines with different floating point
  597.      formats have not all been made to work.  GNU CC now has a floating
  598.      point emulator with which these can work, but each target machine
  599.      description needs to be updated to take advantage of it.
  600.    * Cross-compilation between machines of different word sizes has not
  601.      really been addressed yet.
  602.    Since GNU CC generates assembler code, you probably need a
  603. cross-assembler that GNU CC can run, in order to produce object files.
  604. If you want to link on other than the target machine, you need a
  605. cross-linker as well.  You also need header files and libraries suitable
  606. for the target machine that you can install on the host machine.
  607. * Menu:
  608. * Steps of Cross::      Using a cross-compiler involves several steps
  609.                           that may be carried out on different machines.
  610. * Configure Cross::     Configuring a cross-compiler.
  611. * Tools and Libraries:: Where to put the linker and assembler, and the C library.
  612. * Cross Headers::       Finding and installing header files
  613.                           for a cross-compiler.
  614. * Cross Runtime::       Supplying arithmetic runtime routines (`libgcc1.a').
  615. * Build Cross::         Actually compiling the cross-compiler.
  616. File: gcc.info,  Node: Steps of Cross,  Next: Configure Cross,  Up: Cross-Compiler
  617. Steps of Cross-Compilation
  618. --------------------------
  619.    To compile and run a program using a cross-compiler involves several
  620. steps:
  621.    * Run the cross-compiler on the host machine to produce assembler
  622.      files for the target machine.  This requires header files for the
  623.      target machine.
  624.    * Assemble the files produced by the cross-compiler.  You can do this
  625.      either with an assembler on the target machine, or with a
  626.      cross-assembler on the host machine.
  627.    * Link those files to make an executable.  You can do this either
  628.      with a linker on the target machine, or with a cross-linker on the
  629.      host machine.  Whichever machine you use, you need libraries and
  630.      certain startup files (typically `crt....o') for the target
  631.      machine.
  632.    It is most convenient to do all of these steps on the same host
  633. machine, since then you can do it all with a single invocation of GNU
  634. CC.  This requires a suitable cross-assembler and cross-linker.  For
  635. some targets, the GNU assembler and linker are available.
  636. File: gcc.info,  Node: Configure Cross,  Next: Tools and Libraries,  Prev: Steps of Cross,  Up: Cross-Compiler
  637. Configuring a Cross-Compiler
  638. ----------------------------
  639.    To build GNU CC as a cross-compiler, you start out by running
  640. `configure'.  You must specify two different configurations, the host
  641. and the target.  Use the `--host=HOST' option for the host and
  642. `--target=TARGET' to specify the target type.  For example, here is how
  643. to configure for a cross-compiler that runs on a hypothetical Intel 386
  644. system and produces code for an HP 68030 system running BSD:
  645.      ./configure --target=m68k-hp-bsd4.3 --host=i386-bozotheclone-bsd4.3
  646. File: gcc.info,  Node: Tools and Libraries,  Next: Cross Headers,  Prev: Configure Cross,  Up: Cross-Compiler
  647. Tools and Libraries for a Cross-Compiler
  648. ----------------------------------------
  649.    If you have a cross-assembler and cross-linker available, you should
  650. install them now.  Put them in the directory `/usr/local/TARGET/bin'.
  651. Here is a table of the tools you should put in this directory:
  652.      This should be the cross-assembler.
  653.      This should be the cross-linker.
  654.      This should be the cross-archiver: a program which can manipulate
  655.      archive files (linker libraries) in the target machine's format.
  656. `ranlib'
  657.      This should be a program to construct a symbol table in an archive
  658.      file.
  659.    The installation of GNU CC will find these programs in that
  660. directory, and copy or link them to the proper place to for the
  661. cross-compiler to find them when run later.
  662.    The easiest way to provide these files is to build the Binutils
  663. package and GAS.  Configure them with the same `--host' and `--target'
  664. options that you use for configuring GNU CC, then build and install
  665. them.  They install their executables automatically into the proper
  666. directory.  Alas, they do not support all the targets that GNU CC
  667. supports.
  668.    If you want to install libraries to use with the cross-compiler,
  669. such as a standard C library, put them in the directory
  670. `/usr/local/TARGET/lib'; installation of GNU CC copies all all the
  671. files in that subdirectory into the proper place for GNU CC to find
  672. them and link with them.  Here's an example of copying some libraries
  673. from a target machine:
  674.      ftp TARGET-MACHINE
  675.      lcd /usr/local/TARGET/lib
  676.      cd /lib
  677.      get libc.a
  678.      cd /usr/lib
  679.      get libg.a
  680.      get libm.a
  681.      quit
  682. The precise set of libraries you'll need, and their locations on the
  683. target machine, vary depending on its operating system.
  684.    Many targets require "start files" such as `crt0.o' and `crtn.o'
  685. which are linked into each executable; these too should be placed in
  686. `/usr/local/TARGET/lib'.  There may be several alternatives for
  687. `crt0.o', for use with profiling or other compilation options.  Check
  688. your target's definition of `STARTFILE_SPEC' to find out what start
  689. files it uses.  Here's an example of copying these files from a target
  690. machine:
  691.      ftp TARGET-MACHINE
  692.      lcd /usr/local/TARGET/lib
  693.      prompt
  694.      cd /lib
  695.      mget *crt*.o
  696.      cd /usr/lib
  697.      mget *crt*.o
  698.      quit
  699. File: gcc.info,  Node: Cross Runtime,  Next: Build Cross,  Prev: Cross Headers,  Up: Cross-Compiler
  700. `libgcc.a' and Cross-Compilers
  701. ------------------------------
  702.    Code compiled by GNU CC uses certain runtime support functions
  703. implicitly.  Some of these functions can be compiled successfully with
  704. GNU CC itself, but a few cannot be.  These problem functions are in the
  705. source file `libgcc1.c'; the library made from them is called
  706. `libgcc1.a'.
  707.    When you build a native compiler, these functions are compiled with
  708. some other compiler-the one that you use for bootstrapping GNU CC.
  709. Presumably it knows how to open code these operations, or else knows how
  710. to call the run-time emulation facilities that the machine comes with.
  711. But this approach doesn't work for building a cross-compiler.  The
  712. compiler that you use for building knows about the host system, not the
  713. target system.
  714.    So, when you build a cross-compiler you have to supply a suitable
  715. library `libgcc1.a' that does the job it is expected to do.
  716.    To compile `libgcc1.c' with the cross-compiler itself does not work.
  717. The functions in this file are supposed to implement arithmetic
  718. operations that GNU CC does not know how to open code, for your target
  719. machine.  If these functions are compiled with GNU CC itself, they will
  720. compile into infinite recursion.
  721.    On any given target, most of these functions are not needed.  If GNU
  722. CC can open code an arithmetic operation, it will not call these
  723. functions to perform the operation.  It is possible that on your target
  724. machine, none of these functions is needed.  If so, you can supply an
  725. empty library as `libgcc1.a'.
  726.    Many targets need library support only for multiplication and
  727. division.  If you are linking with a library that contains functions for
  728. multiplication and division, you can tell GNU CC to call them directly
  729. by defining the macros `MULSI3_LIBCALL', and the like.  These macros
  730. need to be defined in the target description macro file.  For some
  731. targets, they are defined already.  This may be sufficient to avoid the
  732. need for libgcc1.a; if so, you can supply an empty library.
  733.    Some targets do not have floating point instructions; they need other
  734. functions in `libgcc1.a', which do floating arithmetic.  Recent
  735. versions of GNU CC have a file which emulates floating point.  With a
  736. certain amount of work, you should be able to construct a floating
  737. point emulator that can be used as `libgcc1.a'.  Perhaps future
  738. versions will contain code to do this automatically and conveniently.
  739. That depends on whether someone wants to implement it.
  740.    If your target system has another C compiler, you can configure GNU
  741. CC as a native compiler on that machine, build just `libgcc1.a' with
  742. `make libgcc1.a' on that machine, and use the resulting file with the
  743. cross-compiler.  To do this, execute the following on the target
  744. machine:
  745.      cd TARGET-BUILD-DIR
  746.      ./configure --host=sparc --target=sun3
  747.      make libgcc1.a
  748. And then this on the host machine:
  749.      ftp TARGET-MACHINE
  750.      binary
  751.      cd TARGET-BUILD-DIR
  752.      get libgcc1.a
  753.      quit
  754.    Another way to provide the functions you need in `libgcc1.a' is to
  755. define the appropriate `perform_...' macros for those functions.  If
  756. these definitions do not use the C arithmetic operators that they are
  757. meant to implement, you should be able to compile them with the
  758. cross-compiler you are building.  (If these definitions already exist
  759. for your target file, then you are all set.)
  760.    To build `libgcc1.a' using the perform macros, use
  761. `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler.
  762. Otherwise, you should place your replacement library under the name
  763. `libgcc1.a' in the directory in which you will build the
  764. cross-compiler, before you run `make'.
  765. File: gcc.info,  Node: Cross Headers,  Next: Cross Runtime,  Prev: Tools and Libraries,  Up: Cross-Compiler
  766. Cross-Compilers and Header Files
  767. --------------------------------
  768.    If you are cross-compiling a standalone program or a program for an
  769. embedded system, then you may not need any header files except the few
  770. that are part of GNU CC (and those of your program).  However, if you
  771. intend to link your program with a standard C library such as `libc.a',
  772. then you probably need to compile with the header files that go with
  773. the library you use.
  774.    The GNU C compiler does not come with these files, because (1) they
  775. are system-specific, and (2) they belong in a C library, not in a
  776. compiler.
  777.    If the GNU C library supports your target machine, then you can get
  778. the header files from there (assuming you actually use the GNU library
  779. when you link your program).
  780.    If your target machine comes with a C compiler, it probably comes
  781. with suitable header files also.  If you make these files accessible
  782. from the host machine, the cross-compiler can use them also.
  783.    Otherwise, you're on your own in finding header files to use when
  784. cross-compiling.
  785.    When you have found suitable header files, put them in
  786. `/usr/local/TARGET/include', before building the cross compiler.  Then
  787. installation will run fixincludes properly and install the corrected
  788. versions of the header files where the compiler will use them.
  789.    Provide the header files before you build the cross-compiler, because
  790. the build stage actually runs the cross-compiler to produce parts of
  791. `libgcc.a'.  (These are the parts that *can* be compiled with GNU CC.)
  792. Some of them need suitable header files.
  793.    Here's an example showing how to copy the header files from a target
  794. machine.  On the target machine, do this:
  795.      (cd /usr/include; tar cf - .) > tarfile
  796.    Then, on the host machine, do this:
  797.      ftp TARGET-MACHINE
  798.      lcd /usr/local/TARGET/include
  799.      get tarfile
  800.      quit
  801.      tar xf tarfile
  802. File: gcc.info,  Node: Build Cross,  Prev: Cross Runtime,  Up: Cross-Compiler
  803. Actually Building the Cross-Compiler
  804. ------------------------------------
  805.    Now you can proceed just as for compiling a single-machine compiler
  806. through the step of building stage 1.  If you have not provided some
  807. sort of `libgcc1.a', then compilation will give up at the point where
  808. it needs that file, printing a suitable error message.  If you do
  809. provide `libgcc1.a', then building the compiler will automatically
  810. compile and link a test program called `cross-test'; if you get errors
  811. in the linking, it means that not all of the necessary routines in
  812. `libgcc1.a' are available.
  813.    If you are making a cross-compiler for an embedded system, and there
  814. is no `stdio.h' header for it, then the compilation of `enquire' will
  815. probably fail.  The job of `enquire' is to run on the target machine
  816. and figure out by experiment the nature of its floating point
  817. representation.  `enquire' records its findings in the header file
  818. `float.h'.  If you can't produce this file by running `enquire' on the
  819. target machine, then you will need to come up with a suitable `float.h'
  820. in some other way (or else, avoid using it in your programs).
  821.    Do not try to build stage 2 for a cross-compiler.  It doesn't work to
  822. rebuild GNU CC as a cross-compiler using the cross-compiler, because
  823. that would produce a program that runs on the target machine, not on the
  824. host.  For example, if you compile a 386-to-68030 cross-compiler with
  825. itself, the result will not be right either for the 386 (because it was
  826. compiled into 68030 code) or for the 68030 (because it was configured
  827. for a 386 as the host).  If you want to compile GNU CC into 68030 code,
  828. whether you compile it on a 68030 or with a cross-compiler on a 386, you
  829. must specify a 68030 as the host when you configure it.
  830.    To install the cross-compiler, use `make install', as usual.
  831. File: gcc.info,  Node: Sun Install,  Next: VMS Install,  Prev: Cross-Compiler,  Up: Installation
  832. Installing GNU CC on the Sun
  833. ============================
  834.    On Solaris (version 2.1), do not use the linker or other tools in
  835. `/usr/ucb' to build GNU CC.  Use `/usr/ccs/bin'.
  836.    Make sure the environment variable `FLOAT_OPTION' is not set when
  837. you compile `libgcc.a'.  If this option were set to `f68881' when
  838. `libgcc.a' is compiled, the resulting code would demand to be linked
  839. with a special startup file and would not link properly without special
  840. pains.
  841.    There is a bug in `alloca' in certain versions of the Sun library.
  842. To avoid this bug, install the binaries of GNU CC that were compiled by
  843. GNU CC.  They use `alloca' as a built-in function and never the one in
  844. the library.
  845.    Some versions of the Sun compiler crash when compiling GNU CC.  The
  846. problem is a segmentation fault in cpp.  This problem seems to be due to
  847. the bulk of data in the environment variables.  You may be able to avoid
  848. it by using the following command to compile GNU CC with Sun CC:
  849.      make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
  850.